﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Infrastructure.Aspect.ExceptionHandling;

namespace Skynet.BusinessLogic.BusinessComponents
{
    public partial class BCExamQueries 
    {
        
        public string QueryExamCategories(QueryExamCategoriesOptions options, Guid? CustomerId = null)
        {
            string result = string.Empty;
            try
            {
                switch (options)
                {
                    case QueryExamCategoriesOptions.MaintenanceView:
                        result = this.XmlDataQueriesService.executeprocedure(Constants.OperationsNames.ExamCategories.MaintenanceView, CustomerId);
                        break;
                    case QueryExamCategoriesOptions.GetAllView:
                        result = this.XmlDataQueriesService.executeprocedure(Constants.OperationsNames.ExamCategories.GetAllCategoriesXML);
                        break;
                    default:
                        break;
                }
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, ExceptionPolicyNames.BusinessComponentPolicy);
                if (rethrow)                
                    throw;
            }
            return result;  
        }
        
    }
}
